/* 
 * File:   vector.h
 * Author: bjorn
 *
 * Created on September 2, 2007, 7:15 PM
 */

#ifndef _VECTOR_H
#define	_VECTOR_H

#include "object.h"
#include "memory.h"    


#ifdef	__cplusplus
extern "C" {
#endif

typedef eruta_pointer ((*vector_each_callback)(eruta_pointer value));    

    
eruta_object(Vector);

extern Vector vector_make(size_t elsize, size_t initsize); 

extern Vector vector_free(Vector self); 

extern size_t vector_size(Vector self); 

extern size_t vector_element_size(Vector self); 

extern eruta_pointer vector_get(Vector self, size_t index); 

extern Vector vector_set(Vector self, size_t index, eruta_pointer value);

extern Vector vector_copy(Vector self, Vector target); 

extern Vector vector_grow(Vector self, size_t newsize); 

extern Vector vector_grow_kill(Vector self, size_t newsize); 

extern Vector vector_set_grow(Vector self, size_t index, eruta_pointer value); 

extern Vector vector_each(Vector self , vector_each_callback callback); 

#ifdef	__cplusplus
}
#endif

#endif	/* _VECTOR_H */

